Conventional random access memory (RAM) arrays have a number of memory cells arranged in rows and columns and include addressing circuitry that addresses a selected row of memory cells. The address of a memory cell corresponds to a physical location of the cell in the memory array. In order to determine if a particular data value is stored on memory, each memory location must be searched. In the course of the search, an address is supplied to the memory and the memory returns the data value stored at that address.
In contrast, in a content addressable memory (CAM), data values are addressed by their content rather than by a physical memory location. In order to determine if a particular data value is stored in the memory, the data value (the comparison value) is supplied to the memory and the rows of the CAM assert or de-assert an associated match signal depending on whether or not the comparison value matches one or more data values stored in the CAM cell row. Optionally, additional data associated with the matched value can be output.
CAM devices are valuable in providing associative look-up based on the contents of the data. A CAM may be preloaded with a pre-defined data set including data to be compared (keys) and, optionally, data to be output when a match is found. The address where the match is found can be used as an index to a secondary memory or other device. For example, CAM devices are used for address look-up functions in Internet data routing. The Internet address is used as the comparison value or key, and is associated with routing information. In another application, image data may be stored using pixel color as the key, thereby allowing pixel data stored in memory to be searched for pixels of a particular color.
Each memory cell of a binary CAM device stores the values 0 and 1, while ternary devices store the values 1, 0 and ‘don't care’. The ‘don't care’ value will match with either a one or a zero. In either case, the output match value is a binary 0 or 1. Ternary CAM devices provide the ability to match variable length words to stored values. A bit in the word can be masked globally or individually.
New requirements in the field of networking are not satisfied by a simple match of a stored word and comparison word. For example, it may be necessary to compare ranges of values. Using present memory devices, multiple comparisons must be made to determine matches within a range.